package com.haixiaoke.saas.house.mapper;

import com.haixiaoke.saas.common.Node;
import com.haixiaoke.saas.house.domain.Building;
import com.haixiaoke.saas.house.domain.Estate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 楼栋信息Mapper接口
 *
 * @author xiaolong
 * @date 2023-10-16
 */
public interface BuildingMapper {
    /**
     * 查询楼栋信息
     *
     * @param buildingId 楼栋信息主键
     * @return 楼栋信息
     */
    Building selectBuildingByBuildingId(String buildingId);

    /**
     * 查询楼栋信息列表
     *
     * @param building 楼栋信息
     * @return 楼栋信息集合
     */
    List<Building> selectBuildingList(Building building);

    /**
     * 新增楼栋信息
     *
     * @param building 楼栋信息
     * @return 结果
     */
    int insertBuilding(Building building);

    /**
     * 修改楼栋信息
     *
     * @param building 楼栋信息
     * @return 结果
     */
    int updateBuilding(Building building);

    /**
     * 删除楼栋信息
     *
     * @param buildingId 楼栋信息主键
     * @return 结果
     */
    int deleteBuildingByBuildingId(Long buildingId);

    /**
     * 批量删除楼栋信息
     *
     * @param buildingIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteBuildingByBuildingIds(Long[] buildingIds);

    /**
     * 统计楼栋数量
     *
     * @param estateId
     * @param delFlag
     * @return
     */
    int selectBuildingByBuildingNumber(@Param("estateId") String estateId,@Param("delFlag") String delFlag,@Param("tenantId") String tenantId);

    /**
     * 根据楼盘id查询楼栋数据
     *
     * @param estateId
     * @param delFlag
     * @return
     */
    List<Building> selectBuildingByEstateId(@Param("estateId") String estateId,@Param("delFlag") String delFlag);

    List<Building> selectBuildingByBuildingIds(Building building);

    Building selectBuildingByEstateIdAndBuildingName(@Param("estateId") String estateId,@Param("buildingName") String buildingName,@Param("tenantId") String tenantId);

    List<Node> selectBuildingLevelList(Building building);
}
